﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DTO;
using DAO;

namespace BUS
{
    public class LoaiThietBiBUS
    {
        public List<LoaiThietBiDTO> LayDanhSachLoaiThietBi()
        {
            LoaiThietBiDAO dao = new LoaiThietBiDAO();
            List<LoaiThietBiDTO> ds = dao.LayDanhSachLoaiThietBi();            
            return ds;
        }

        public LoaiThietBiDTO LayThongTinLoaiThietBi(int ma)
        {
            LoaiThietBiDAO dao = new LoaiThietBiDAO();
            LoaiThietBiDTO dto = dao.LayThongTinLoaiThietBi(ma);
            return dto;
        }

        public string LayTenLoaiThietBiTheoMa(int ma)
        {
            LoaiThietBiDAO dao = new LoaiThietBiDAO();
            string ten = dao.LayTenLoaiThietBiTheoMa(ma);
            return ten;
        }

        public void ThemLoaiThietBi(string ten)
        {
            LoaiThietBiDAO dao = new LoaiThietBiDAO();
            dao.ThemLoaiThietBi(ten);
        }

        public void XoaLoaiThietBi(int ma)
        {
            LoaiThietBiDAO dao = new LoaiThietBiDAO();
            dao.XoaLoaiThietBi(ma);
        }

        public void CapNhatLoaiThietBi(LoaiThietBiDTO dto)
        {
            LoaiThietBiDAO dao = new LoaiThietBiDAO();
            dao.CapNhatLoaiThietBi(dto);
        }
    }
}
